<%-- 
    Document   : listarReservas
    Created on : 29/09/2013, 21:42:14
    Author     : Cristian
--%>

<%@page import="model.Reserva"%>
<%@page import="persistence.ReservaDAO"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Iterator"%>
<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
    <<head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>FAZER RESERVA</title>
    </head>
</body> <body background="imagens/fundo2.png">


    <div style="margin-top: 160px; margin-left: 35%">
        <div style="margin-top: -20px;">
            <b>LISTAR RESERVAS</b>
        </div>

        <table border="1">
            <thead>
                <tr>
                    <th><b>Cliente</b></th>
                    <th><b>ivro</b></th>
                    <th><b>Data Reserva</b></th>
                    <th><b>Data Entrega</b></th>
                    <th><b>Telefone</b></th>
                </tr>
            </thead>
            <tbody>
                <%
                    ArrayList reservas = ReservaDAO.getInstace().listaReservas();
                    Iterator iteratorReserva = reservas.iterator();
                    while (iteratorReserva.hasNext()) {
                        Reserva reserva = (Reserva) iteratorReserva.next();
                %>
                <tr>
                    <th><%= reserva.getCliente().getNome()%></th>
                    <th><%= reserva.getLivro().getNomeLivro()%></th>
                    <th><%= reserva.getData_reserva()%></th>
                    <th><%= reserva.getData_entrega()%></th>
                   <th><%= reserva.getCliente().getTelefone()%></th>
                </tr>
                <%
                    } //end while

                %>
            </tbody>
        </table>

    </div>
    <div style=" margin-left: 935px;">
        <a href="index.jsp">   
            <img src="imagens/voltar.png" width="68" height="30"/>  
        </a>

    </div>


</body>
</html>
